import request from "@/utils/axios-request.js";

const AUTH_BASE_URL = "/api/v1/auth";

const AuthAPI = {
    getCaptcha() {
        return request({
            url: `${AUTH_BASE_URL}/captcha`,
            method: 'GET',
            bfLoading: false,
        })
    },
    login(data) {
        return request({
            url: `${AUTH_BASE_URL}/login`,
            method: 'POST',
            data,
        })
    },
    getInfo() {
        return request({
            url: `${AUTH_BASE_URL}/profile`,
            method: 'GET',
        })
    },
    logout() {
        return new Promise((resolve, reject) => {
            setTimeout(() => {
                resolve()
            }, 1000)
        })
    },
    updatePwd(data) {
        return request({
            url: `${AUTH_BASE_URL}/update-password`,
            method: 'put',
            data,
        })
    }
}

export default AuthAPI